<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<!-- Set render engine for 360 browser -->
	<meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->

	<link href="/public/simpleboot/themes/<?php echo C('SP_ADMIN_STYLE');?>/theme.min.css?1" rel="stylesheet">
    <link href="/public/simpleboot/css/simplebootadmin.css?8" rel="stylesheet">
    <link href="/public/js/artDialog/skins/default.css" rel="stylesheet" />
	<link href="/public/css/other.css?<?php echo time(); ?>" rel="stylesheet" />
    <link href="/public/simpleboot/font-awesome/4.4.0/css/font-awesome.min.css"  rel="stylesheet" type="text/css">
    <style>
		form .input-order{margin-bottom: 0px;padding:3px;width:40px;}
		.table-actions{margin-top: 5px; margin-bottom: 5px;padding:0px;}
		.table-list{margin-bottom: 0px;}
	</style>
	<!--[if IE 7]>
	<link rel="stylesheet" href="/public/simpleboot/font-awesome/4.4.0/css/font-awesome-ie7.min.css">
	<![endif]-->
	<script type="text/javascript">
	//全局变量
	var GV = {
	    ROOT: "/",
	    WEB_ROOT: "/",
	    JS_ROOT: "public/js/",
	    APP:'<?php echo (MODULE_NAME); ?>'/*当前应用名*/
	};
	</script>
    <script src="/public/js/jquery.js"></script>
    <script src="/public/js/jquery.quicksearch.js"></script>
    <script src="/public/js/wind.js"></script>
    <script src="/public/simpleboot/bootstrap/js/bootstrap.min.js"></script>
    <script>
    	$(function(){
    		$("[data-toggle='tooltip']").tooltip();
    	});
    </script>
<?php if(APP_DEBUG): ?><style>
		#think_page_trace_open{
			z-index:9999;
		}
	</style><?php endif; ?>
<style type="text/css">
.print {border: 2px solid #c3c3c3;
    box-shadow: 6px 7px 12px #c3c3c3;
padding: 0;
margin: 0;
width: 220px;margin:0 auto;

}
</style>

<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li ><a href="<?php echo U('AdminSale/add',array('id'=>empty($item['id'])?'':$item['id']));?>" target="_self">卡片消费</a></li>
			<li class="active"><a href="javascript:;" target="_self">消费账单</a></li>
		</ul>
		<div class="row-fluid">
			<div class="print" id="print">
				<style>
				/*****************
				小票
				*****************/
				.print_title {text-align: center;width: 100%;font-size: 18px;border-bottom: 1px groove;padding-bottom: 12px;margin-bottom: 12px;}
				.print_area{font-size:12px;padding: 20px 40px 20px 10px;}
				.print_row {margin-bottom: 12px;}
				.print_row .left{display: inline-block;font-size: 12px;line-height: 12px;}
				.spliter{border-top: 1px dashed;}
				.print_footer{padding-bottom: 24px;border-bottom: 1px groove;}
				</style>
				<div class="print_area">
					<div class="print_title">刷卡消费单</div>
					<div class="print_content">
						<div class="print_row">
							<span class="left">流水号：<?php echo ($sale_data["number"]); ?></label>
						</div>
						<div class="print_row">
							<span class="left">消费时间：<?php echo date("Y-m-d H:i:s",$sale_data['create_time']);?></label>
						</div>
						<div class="print_row">
							<span class="left">消费商品：<?php echo ($sale_data["goods_name"]); ?></label>
						</div>
						<div class="print_row">
							<span class="left">商品单价：<?php echo ($sale_data["goods_unit_price"]); ?>/<?php echo ($sale_data["goods_unit"]); ?></label>
						</div>
						<div class="print_row">
							<span class="left">商品数量：<?php echo ($sale_data["goods_num"]); echo ($sale_data["goods_unit"]); ?></label>
						</div>
						<div class="print_row">
							<span class="left">订单总价：<?php echo ($sale_data["goods_price"]); ?></label>
						</div>
						<div class="print_row">
							<span class="left">优惠金额：<?php echo ($sale_data["dis_price"]); ?></label>
						</div>
						<div class="print_row">
							<span class="left">实付金额：<?php echo ($sale_data["price"]); ?></label>
						</div>
						<div class="print_row">
							<span class="left">消费卡号：<?php echo ($sale_data["card_number"]); ?></label>
						</div>
						<div class="print_row">
							<span class="left">卡内余额：<?php echo ($sale_data["plus_price"]); ?></label>
						</div>
						<div class="print_row">
							<span class="left">本次积分：<?php echo ($sale_data["total_add_point"]); ?></label>
						</div>
						<div class="print_row">
							<span class="left">卡内积分：<?php echo ($sale_data["plus_point"]); ?></label>
						</div>
						<?php if($card_data['vip_name']): ?><div class="print_row">
							<span class="left">持卡会员：<?php echo ($card_data["vip_name"]); ?></span>
						</div><?php endif; ?>
						<?php if($card_data['vip_phone']): ?><div class="print_row">
							<span class="left">会员手机：<?php echo ($card_data["vip_phone"]); ?></span>
						</div><?php endif; ?>
						<?php if($card_data['vip_plate_number']): ?><div class="print_row">
							<span class="left">会员车牌：<?php echo ($card_data["vip_plate_number"]); ?></span>
						</div><?php endif; ?>
						<div class="print_row">
							<span class="left">消费机构：<?php echo ($sale["sale_name"]); ?></label>
						</div>
						<div class="print_row">
							<span class="left">操作员：<?php echo ($sale_user["user_nicename"]); ?></label>
						</div>
						<div class="print_row">
							<span class="left"><?php echo ($sale_data["desc"]); ?></span>
						</div>
						<div class="spliter"></div>
					</div>
					<div class="print_footer">
						<div>一号物流油气卡平台</div>	
						<div>感谢您的使用！</div>
					</div>
				</div>
			</div>

			<div class="form-actions">
				<p class="print_download" style="display:none">请下载打印插件 <a href="/public/install/CLodop_Setup_for_Win32NT.exe">CLodop_Setup_for_Win32NT.exe</a></p>
				<!-- <a href="javascript:prn1_preview()">打印预览</a> -->
				<a class="btn btn-primary js-ajax-submit"  href="javascript:prn1_printA()">选择打印机</a>
				<a class="btn btn-primary js-ajax-submit" href="javascript:prn1_preview()">打印小票</a>
				<a class="btn" href="<?php echo U('AdminSale/add');?>">返回</a>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="/public/js/common.js"></script>
	<script type="text/javascript" src="/public/js/jQuery.js"></script>
	<script type="text/javascript" src="/public/js/lodop/LodopFuncs.js"></script>
	<script language="javascript" type="text/javascript">   
        var LODOP; //声明为全局变量 
		function prn1_preview() {
			CreateOneFormPage();	
				LODOP.PREVIEW();
		};
		function prn1_print() {		
			CreateOneFormPage();
			LODOP.PRINT();	
		};
		function prn1_printA() {		
			CreateOneFormPage();
			LODOP.PRINTA(); 	
		};
		function CreateOneFormPage(){
			LODOP=getLodop(); 
			if (LODOP.VERSION) {
				LODOP.PRINT_INIT("一号物流小票打印");
				LODOP.SET_PRINT_STYLE("FontSize",18);
				LODOP.SET_PRINT_STYLE("Bold",1);
				LODOP.SET_PRINT_PAGESIZE(3,580,45,"");
				// LODOP.ADD_PRINT_TEXT(50,231,260,39,"打印页面部分内容");
				LODOP.ADD_PRINT_HTM(0,0,220,441,document.getElementById("print").innerHTML);
			}else{
				$('.print_download').show();
			}
		};	                     
	</script>
	</body>
</html>